export default {
  mode: 'universal',
  /*
  ** Headers of the page
  */
  head: {
    title: '华章',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1.0, user-scalable=no' },
      { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }

    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
    ],
    // script:[
    //   {type:'text/javascript',src:'https://hm.baidu.com/hm.js?511f9a3883c0161e8e7237f9a362c0be'}
    // ]
  },
  /*
  ** Customize the progress-bar color
  */
  //loading: { color: '#fff' },
  loading: {
    color: 'rgb(0,86,177)',
    height: '5px'
  },
  /*
  ** Global CSS
  */
  css: [
    'element-ui/lib/theme-chalk/index.css',
    'swiper/dist/css/swiper.css',
    {src:'~assets/css/style.scss',lang:'scss'},
    {src:'~assets/css/mini-style.scss',lang:'scss'}
  ],
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '@/plugins/element-ui',
    '@/plugins/api',
    '@/plugins/global-function',
    {
      // 引入一个插件，这里的 ssr 表示使用服务端渲染
      src: "plugins/vue-swiper.js", ssr: false
    },

  ],
  /*
  ** Nuxt.js dev-modules
  */
  buildModules: [
  ],
  /*
  ** Nuxt.js modules
  */
  modules: [
    '@nuxtjs/axios',
  ],
  /*
  ** Build configuration
  */
  // router: {
  //   // 在每页渲染前运行 middleware/user-agent.js 中间件的逻辑
  //   middleware: 'user-agent'
  // },

  build: {
    transpile: [/^element-ui/],
    vendor: ['axios'],
    extractCSS: { allChunks: true },
    /*
    ** You can extend webpack config here
    */
    // extend (config, ctx) {
    //   config.devtool = ctx.isClient ? 'eval-source-map' : 'inline-source-map'
    //
    //   // Run ESLint on save
    //   if (ctx.isDev && ctx.isClient) {
    //     config.module.rules.push({
    //       enforce: 'pre',
    //       test: /\.(js|vue)$/,
    //       loader: 'eslint-loader',
    //       exclude: /(node_modules)/
    //     })
    //   }
    // }
  },
  server: {
    port: 9999, // default: 3000
    host: '0.0.0.0' // default: localhost
  }
}
